package com.surfacing.rcp.model.entity;

import com.surfacing.rcp.model.common.AbstractMessage;

public class ProtokollNr extends AbstractMessage {
	// unique identification string
	public final static String ID = "ProtokollNr";

	private String nextNumber;

	/**
	 * Class constructor for a staff member
	 */
	public ProtokollNr() {
		super(ID);
		// set default values
		nextNumber = "";
	}

	public ProtokollNr(String nextNumber) {
		this();
		setNextNumber(nextNumber);
	}

	/**
	 * Returns a string based description of the object
	 * 
	 * @return the description of the object
	 */
	@Override
	public String toString() {
		return nextNumber;
	}

	/*
	 * Returns the calculated hash code based on the staff member id.<br> Two
	 * staff members have the same hash code if the id is the same.
	 * 
	 * @return the calculated hash code
	 */
	@Override
	public int hashCode() {
		return 31 + nextNumber.length();
	}

	/**
	 * Returns whether the objects are equal or not.<br>
	 * Two staff members are equal if, and only if, the id is the same.
	 * 
	 * @return true if the id is the same otherwise false.
	 */
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		final ProtokollNr other = (ProtokollNr) obj;
		if (!nextNumber.equals(other))
			return false;
		return true;
	}

	public String getNextNumber() {
		return nextNumber;
	}

	public void setNextNumber(String nextNumber) {
		this.nextNumber = nextNumber;
	}

}
